#include "Resource.h"
#include "ResourcePool.h"

namespace Display
{

	Resource::Resource(ResourcePool * pool)
	{
		refs = 0;
		this->pool = pool;
	}


	Resource::~Resource(void)
	{
		pool = nullptr;
	}

	void Resource::AddRef()
	{
		refs++;
	}

	void Resource::DeRef()
	{
		refs--;
		
		if(refs == 0)
			OnZeroRefReach();
	}
}